<include file="Public/siteTopbar" />
<include file="Public/header" />
    <script src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
    <script src="__PUBLIC__/js/global.js"></script>
    <script src="__PUBLIC__/js/pc_common.js"></script>
    <script src="__PUBLIC__/js/layer/layer.js"></script>

<link rel="stylesheet" href="__STATIC__/css/cart.css" type="text/css">




<div class="layout after-ta">
    <div class="sc-list">
        <form name="cart_form" id="cart_form" method="post" action="{:U('Home/Cart/cart2')}">
            <div id="ajax_return"><!--  ajax renturn --></div>
            <div id="ajax_return_html"></div>
        </form>
    </div>

    <form id="form2" name="form2" method="post" action="{:U('Home/Cart/cart2')}">
        <input name="hd_id" id="hd_id_1" type="hidden" value=""/>
    </form>
</div>
<!--------footer-开始-------------->
<include file="Public/footer" />
<!--------footer-结束-------------->

<script>
    $(document).ready(function(){
        ajax_cart_list();
     // ajax_cart_listone(); // ajax 请求获取购物车列表
    });
    // ajax 提交购物车
    var before_request = 1; // 上一次请求是否已经有返回来, 有才可以进行下一次请求
    function ajax_cart_list(){
        /*if(before_request == 0) // 上一次请求没回来 不进行下一次请求
            return false;
        before_request = 0;*/
        $.ajax({
            type : "POST",
            url:"{:U('Home/Cart/ajaxCartList')}",//+tab,
            data : $('#cart_form').serialize(),// 你的formid

            beforeSend:function(XMLHttpRequest){
                //$("#ajax_return").html("<div style='padding: 100px 0;font-weight: bold;color:#e50073;'> <center><img src='__STATIC__/images/loading.gif' width='30' style='margin:0 15px;' />Shopping cart loading please wait</center></div>");
            },
            success: function(data){

                $("#ajax_return").html('');
                $("#ajax_return").append(data);
                before_request = 1;
            },
            error: function (xhr, status) {
                if (xhr.status == 0) {
                    setTimeout(function(){},300);
                }
            }
        });
    }

</script>



</body>
</html>
